package com.xjgc.real_time.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: 小逗号
 * @date: 2023/8/8
 * @description:
 * @since:
 */
@Getter
@AllArgsConstructor
public enum RecordNode {
    /**
     * 记录节点
     */
    BIZ_MSI_SAP_MSI_BIZ_1(1, "接收业务数据"),
    BIZ_MSI_SAP_MSI_BIZ_2(2, "交SAP处理"),
    BIZ_MSI_SAP_MSI_BIZ_3(3, "SAP处理结果"),
    BIZ_MSI_SAP_MSI_BIZ_4(4, "返回业务系统"),

    BIZ_MSI_BIZ_1(11, "接收业务请求"),
    BIZ_MSI_BIZ_2(12, "返回业务系统"),

    SAP_MSI_BIZ1(21, "接收SAP数据"),
    SAP_MSI_BIZ2(22, "SAP数据推送业务系统"),

    /*中间库定时任务*/
    QRTZ_TOKEN(100, "获取Token"),
    QRTZ_REQ(101, "发送请求"),
    QRTZ_RES(102, "接收返回"),



    ;

    private int code;
    private String desc;

    public static String getDescByCode(int code) {
        for (RecordNode recordNode : RecordNode.values()) {
            if (recordNode.code == code) {
                return recordNode.desc;
            }
        }
        return code + "";
    }
}
